import { Component } from '@angular/core';
import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import 'rxjs/add/operator/switchMap';
import { Observable } from 'rxjs/Observable'
import { OnInit } from '@angular/core';

@Component({
    selector : 'bx',
    template : 'bbbb'
})
export class BComponent implements OnInit{
    constructor(private route : ActivatedRoute){
        
    }
    ngOnInit(){
        console.log('lllllllllllllllllll');
        this.route.paramMap.switchMap((p:ParamMap)=>p.get('id')?p.get('id'):'cc').subscribe(id=>console.log(id));
    }
}